﻿
$(document).ready(function () {
    $("#news-carousel .carousel").show();
    $("#news-carousel .carousel").jCarouselLite({
        btnNext: "#news-carousel .btn-next",
        btnPrev: "#news-carousel .btn-prev",
        visible: 1,
        //circular: false
    });
    $('#login').bind('click', checkRemeberme);
    getLastLoginDetails();


});

function getLastLoginDetails() {
    //var credentials = localStorage.getItem('fireStoneAccount');
    var Username = localStorage.getItem('fireStoneAccountUserName');
    var Password = localStorage.getItem('fireStoneAccountPassword');
    var rememberme = localStorage.getItem('FirestoneRemeberMe');
    if (rememberme && Username && Password) {
        $('#UserName').val(Username);
        $('#Password').val(Password);
    }
}


function checkRemeberme() {
    if ($('#RememberMe').is(':checked')) {
        var credentials = {
            UserName: $('#UserName').val(),
            Password: $('#Password').val(),
            RememberMe: true
        }
        localStorage.setItem('fireStoneAccountUserName', credentials.UserName);
        localStorage.setItem('fireStoneAccountPassword', credentials.Password);
        localStorage.setItem('FirestoneRemeberMe', true);


    }
    else {
        localStorage.setItem('fireStoneAccountUserName', '');
        localStorage.setItem('fireStoneAccountPassword', '');
        localStorage.setItem('FirestoneRemeberMe', false);
    }

}


(function (b, o, i, l, e, r) {
    b.GoogleAnalyticsObject = l; b[l] || (b[l] =
    function () { (b[l].q = b[l].q || []).push(arguments) }); b[l].l = +new Date;
    e = o.createElement(i); r = o.getElementsByTagName(i)[0];
    e.src = '//www.google-analytics.com/analytics.js';
    r.parentNode.insertBefore(e, r)
}(window, document, 'script', 'ga'));
ga('create', 'UA-XXXXX-X'); ga('send', 'pageview');
